import { RouteRecordRaw } from 'vue-router'

// 静态路由
const routes: RouteRecordRaw[] = [
  {
    name: 'login',
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    meta: { title: '登录', hidden: true }
  },
  {
    name: 'layout',
    path: '/',
    component: () => import('@/layout/index.vue'),
    meta: { title: 'layout', hidden: false, icon: 'HomeFilled' },
    redirect: '/home',
    children: [
      {
        name: 'home',
        path: '/home',
        component: () => import('@/views/home/index.vue'),
        meta: { title: '首页', hidden: false, icon: 'HomeFilled' }
      }
    ]
  },
  {
    name: '404',
    path: '/404',
    component: () => import('@/views/common/error/404.vue'),
    meta: { title: '404', hidden: true }
  },
  {
    name: 'any',
    path: '/:pathMatch(.*)*',
    redirect: '/404',
    meta: { title: '任意路由', hidden: true }
  },
  {
    name: 'screen',
    path: '/screen',
    component: () => import('@/views/screen/index.vue'),
    meta: { title: '数据大屏', icon: 'Platform' }
  },
  {
    name: 'acl',
    path: '/acl',
    component: () => import('@/layout/index.vue'),
    meta: { title: '权限管理', hidden: false, icon: 'Lock' },
    redirect: '/acl/user',
    children: [
      {
        name: 'aclUser',
        path: '/acl/user',
        component: () => import('@/views/acl/user/index.vue'),
        meta: { title: '用户管理', hidden: false, icon: 'User' }
      },
      {
        name: 'aclRole',
        path: '/acl/role',
        component: () => import('@/views/acl/role/index.vue'),
        meta: { title: '角色管理', hidden: false, icon: 'UserFilled' }
      },
      {
        name: 'aclMenu',
        path: '/acl/menu',
        component: () => import('@/views/acl/menu/index.vue'),
        meta: { title: '菜单管理', hidden: false, icon: 'Grid' }
      }
    ]
  },
  {
    name: 'product',
    path: '/product',
    component: () => import('@/layout/index.vue'),
    meta: { title: '商品管理', icon: 'Goods' },
    redirect: '/product/brand',
    children: [
      {
        name: 'productBrand',
        path: '/product/brand',
        component: () => import('@/views/product/brand/index.vue'),
        meta: { title: '品牌管理', icon: 'ShoppingCartFull' }
      },
      {
        name: 'productAttr',
        path: '/product/attr',
        component: () => import('@/views/product/attr/index.vue'),
        meta: { title: '属性管理', icon: 'SetUp' }
      },
      {
        name: 'productSpu',
        path: '/product/spu',
        component: () => import('@/views/product/spu/index.vue'),
        meta: { title: 'SPU管理', icon: 'ScaleToOriginal' }
      },
      {
        name: 'productSku',
        path: '/product/sku',
        component: () => import('@/views/product/sku/index.vue'),
        meta: { title: 'SKU管理', icon: 'Document' }
      }
    ]
  }
]

export default routes
